# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=git-dumper
pkgver=1.0.8.r1.g544a3e5
pkgrel=1
epoch=1
pkgdesc='A tool to dump a git repository from a website.'
arch=('any')
groups=('blackarch' 'blackarch-scanner' 'blackarch-webapp')
url='https://github.com/arthaud/git-dumper'
license=('MIT')
depends=('python' 'python-beautifulsoup4' 'python-dulwich' 'python-pysocks'
         'python-requests')
makedepends=('git' 'python-build' 'python-pip')
source=("git+https://github.com/arthaud/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname
  echo $(git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g')
}

build() {
  cd $pkgname
  /usr/bin/pyproject-build --wheel --outdir="$startdir/dist"
}

package() {
  cd $pkgname
  pip install --verbose \
              --disable-pip-version-check \
              --no-warn-script-location \
              --ignore-installed \
              --no-compile \
              --no-deps \
              --root="$pkgdir" \
              --prefix=/usr \
              --no-index \
              --find-links="file://$startdir/dist" \
              "$pkgname"
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

